//package com.linyx.simpleboot.config;
//
//import java.io.IOException;
//import java.util.List;
//import java.util.Properties;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.boot.SpringApplication;
//import org.springframework.boot.env.EnvironmentPostProcessor;
//import org.springframework.boot.env.YamlPropertySourceLoader;
//import org.springframework.core.Ordered;
//import org.springframework.core.env.ConfigurableEnvironment;
//import org.springframework.core.env.PropertiesPropertySource;
//import org.springframework.core.env.PropertySource;
//import org.springframework.core.io.Resource;
//import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
//
//
//
//
//
//
//
//
//
//
//public class EnvironmentAutoDetector
//  implements EnvironmentPostProcessor, Ordered
//{
//  private static Logger log = LoggerFactory.getLogger(EnvironmentAutoDetector.class);
//
//
//
//  
//  public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) {
//    PathMatchingResourcePatternResolver pathMatchingResourcePatternResolver = new PathMatchingResourcePatternResolver();
//    try {
//      String proLocate = "classpath:/config/*.properties";
//      
//      Resource[] propResources = null;
//      propResources = pathMatchingResourcePatternResolver.getResources(proLocate);
//      if (propResources != null && propResources.length > 0) {
//        for (Resource propRs : propResources) {
//          Properties prop = new Properties();
//          prop.load(propRs.getInputStream());
//          
//          PropertiesPropertySource propSource = new PropertiesPropertySource(propRs.getFilename(), prop);
//          environment.getPropertySources().addLast(propSource);
//        } 
//      }
//      
//    
//    } catch (IOException e) {
//      
//      log.error("����������������", e);
//    } 
//  }
//
//
//
//
//  
//  public int getOrder() { return 0; }
//}
